<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>客户贡献分析</title>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/jquery-easyui-1.8.6/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/jquery-easyui-1.8.6/themes/icon.css">
    <script type="text/javascript" src="${pageContext.request.contextPath}/jquery-easyui-1.8.6/jquery.min.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/jquery-easyui-1.8.6/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/jquery-easyui-1.8.6/locale/easyui-lang-zh_CN.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/common.js"></script>
</head>
<body style="margin: 1px">
<table id="dg" title="客户贡献分析" class="easyui-datagrid" fitColumns="true" pagination="true" rownumbers="true"
       url="${pageContext.request.contextPath}/customer/findCustomerGx.do" fit="true" toolbar="#dg-tb">
    <thead>
    <tr>
        <th field="name" width="300" align="center">客户名称</th>
        <th field="gx" width="100" align="center">订单总金额(元)</th>
    </tr>
    </thead>
</table>
<div id="dg-tb">
    <div>
        &nbsp;客户名称：&nbsp;<input class="easyui-textbox" id="s_name" size="20"/>
        <a href="javascript:search()" class="easyui-linkbutton" iconCls="icon-search" plain="true">搜索</a>
    </div>
</div>

</body>
</html>

<script type="text/javascript">

    $(function () {
        $('#s_name').each(function (index,element){
            $(this).textbox('textbox').bind('keydown', function (e) {
                if (e.keyCode == 13) {   // 当按下回车键时接受输入的值。
                    search();
                }
            });
        });
    });

    function search() {
        $("#dg").datagrid('load', {
            "name": $("#s_name").val()
        });
    }

</script>